<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

<script type="text/javascript">
	//用户列表
	function list() {
		let xhr = new XMLHttpRequest()

		xhr.open('get',"http://wish.byesame.com/admin?page=1&rows=10")

		//从本地存储里面拿数据localStorage.getItem('属性名'))
		//token 令牌 用户登录之后，后端会返回一串token,登录后的操作都要依据token，token存在且未过期才能继续操作
		xhr.setRequestHeader('token',localStorage.getItem('token'))
		xhr.send()

		xhr.onreadystatechange = function() {
			if(xhr.readyState == 4){
				let res = JSON.parse(xhr.responseText)
				console.log(res)
			}
		}


	}
	list()
</script>
</body>
</html>